.\"
.\" Copyright (c) 2000-2011 Apple Computer, Inc. All rights reserved.
.\"
.\" This file contains Original Code and/or Modifications of Original Code
.\" as defined in and that are subject to the Apple Public Source License
.\" Version 2.0 (the 'License'). You may not use this file except in
.\" compliance with the License. Please obtain a copy of the License at
.\" http://www.opensource.apple.com/apsl/ and read it before using this
.\" file.
.\" 
.\" The Original Code and all software distributed under the License are
.\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
.\" Please see the License for the specific language governing rights and
.\" limitations under the License.
.\"
.Dd September 26, 2011
.Dt IOREG 8
.Os Darwin
.Sh NAME
.Nm ioreg
.Nd show I/O Kit registry
.Sh SYNOPSIS
.Nm
.Op Fl abfilrtx
.Op Fl c Ar class
.Op Fl d Ar depth
.Op Fl k Ar key
.Op Fl n Ar name
.Op Fl p Ar plane
.Op Fl w Ar width
.Sh DESCRIPTION
.Nm
displays the I/O Kit registry.  It shows the hierarchical registry structure
as an inverted tree.  The provider-client relationships among those objects
is shown as follows:
.Pp
+-o provider
  |
  +-o client
.Pp
By default, object properties are not shown.  The use of the
.Fl c ,
.Fl k ,
.Fl l ,
or
.Fl n
options cause
.Nm
to show properties for objects that match the specified criteria.
.Pp
By supplying the
.Fl r
option, the user may specify the object which will
appear at the root of the tree with the
.Fl c ,
.Fl k ,
or
.Fl n 
options.  If root matches more
than one object, multiple trees will be displayed.
.Pp
The options are as follows:
.Pp
.Bl -tag -width flag
.It Fl a
Archive the output in XML.
.It Fl b
Show the object name in bold.
.It Fl c
Show the object properties only if the object is an instance of, or derives from, the specified
C++
.Ar class
(e.g. IOService).
.It Fl d
Limit tree traversal to the specified
.Ar depth .
The depth limit is
applied with respect to each subtree root individually.  Therefore,
supplying a depth of 1 will cause
.Nm
to display only (sub)tree
root nodes; children will not be shown.
.It Fl f
Enable smart formatting.
.Nm
knows how to format certain properties
so that the output is more readable and meaningful, decoding
data fields where appropriate.  Currently supported are `reg',
`assigned-addresses', `slot-names', `ranges', `interrupt-map',
`interrupt-parent`, and `interrupts'.
.It Fl i
Show the object inheritance.
.It Fl k
Show the object properties only if the object has the specified
.Ar key .
Substrings do not match; the specified key must be a full
property name.
.It Fl l
Show properties for all displayed objects.
.It Fl n
Show the object properties only if the object has the specified
.Ar name .
The object location, if any, is considered part of the name, thus
pci@f0000000 and pci@f4000000 are distinct names.
.It Fl p
Traverse the registry over the specified
.Ar plane .
The default plane value is ``IOService''.  The other planes, such as ``IODeviceTree'', can be found under the ``IORegistryPlanes'' property of the root object (ioreg -d 1 -k IORegistryPlanes).
.It Fl r
Show subtrees rooted by objects that match the specified criteria.  If none of
.Fl c ,
.Fl k ,
or
.Fl n 
are supplied,
.Fl r 
has no effect.
.It Fl t
Show tree location of each subtree.  This option causes
.Nm
to display all nodes between the I/O Kit Root and the root of the
displayed subtree, i.e. the subtree's parent, grandparent, etc.
.It Fl w
Clip the output to the specified line
.Ar width .
The default width value is the current screen size.  A value of 0 specifies an unlimited line width.
.It Fl x
Show data and numbers as hexadecimal.
.El
